package com.hcc.repository.gen.config;

import com.hcc.repository.core.utils.StrUtils;
import lombok.Data;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

/**
 * JavaDocConfig
 *
 * @author hushengjun
 * @since 2023/9/18
 */
@Data
public class JavaDocConfig {

    private String author;
    private String since;

    public String getAuthor() {
        if (StrUtils.isEmpty(author)) {
            return System.getProperty("user.name");
        }
        return author;
    }

    public String getSince() {
        if (StrUtils.isEmpty(since)) {
            return DateTimeFormatter.ofPattern("yyyy/MM/dd").format(LocalDate.now());
        }
        return since;
    }

}
